﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace CameraClient.CForm
{

    [System.Runtime.InteropServices.ComVisible(true)]
    public partial class FormWebBrowser : Form
    {
        public FormWebBrowser()
        {
            InitializeComponent();
        }

        private void FormWebBrowser_Load(object sender, EventArgs e)
        {
       

            Thread.Sleep(1000);

            initWebBrowser();

            Thread.Sleep(1000);

        }

        private void initWebBrowser()
        {
            //防止 WebBrowser 控件打开拖放到其上的文件。
            webBrowser1.AllowWebBrowserDrop = false;

            //防止 WebBrowser 控件在用户右击它时显示其快捷菜单.
            webBrowser1.IsWebBrowserContextMenuEnabled = false;

            //以防止 WebBrowser 控件响应快捷键。
            webBrowser1.WebBrowserShortcutsEnabled = false;

            //以防止 WebBrowser 控件显示脚本代码问题的错误信息。    
            webBrowser1.ScriptErrorsSuppressed = true;

            //可以通过这个属性，把WINFROM中的变量，传递到JS中，供内嵌的网页使用
            webBrowser1.ObjectForScripting = this;


        }

        private void FormWebBrowser_FormClosing(object sender, FormClosingEventArgs e)
        {
            this.webBrowser1.Dispose();
        }


        private void foxButton1_Click(object sender, EventArgs e)
        {
            this.webBrowser1.Url = new Uri(@"D:/Code/zzl/CameraClient/摄像监控系统/line-stack.html");
        }

        private void button1_Click(object sender, EventArgs e)
        {
            foxButton1_Click(null, null); ;

        }
    }
}
